﻿//-----------------------------------------------------------------------
// <copyright file="FileTask.cs" company="FastNET Services">
//     Copyright (c) 2007-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings

using System.Collections.Generic;
using FastNET.CleanAct.Client.Interfaces.Tasks.File;

#endregion

namespace FastNET.CleanAct.Client.TaskProcessing.Basic.Tasks.File
{
    /// <summary>
    /// Basic class for all file tasks
    /// </summary>
    internal class FileTask : Task, IFileTask
    {
        #region Variables

        private readonly Dictionary<int, string> _sourceFiles;
        private readonly List<int> _erroredFileIDs;
        private readonly List<int> _successfulFileIDs;

        #endregion

        #region CTor/DTor

        /// <summary>
        /// Initializes a new instance of the FileTask class
        /// </summary>
        public FileTask()
        {
            _sourceFiles = new Dictionary<int, string>();
            _erroredFileIDs = new List<int>();
            _successfulFileIDs = new List<int>();
        }

        #endregion

        #region Public Collection Properties

        /// <summary>
        /// Gets a list of all source files and IDs for each entry
        /// </summary>
        public Dictionary<int, string> SourceFiles
        {
            get
            {
                return _sourceFiles;
            }
        }

        /// <summary>
        /// Gets a list of all the file IDs that encountered errors
        /// </summary>
        public List<int> ErroredFileIDs
        {
            get
            {
                return _erroredFileIDs;
            }
        }

        /// <summary>
        /// Gets a list of all the file IDs that were successful errors
        /// </summary>
        public List<int> SuccessfulFileIDs
        {
            get
            {
                return _successfulFileIDs;
            }
        }

        #endregion
    }
}